<?php
/*
 * 手机客户端 首页数据
 * 传入参数 
 * 2013-12-02
 */
include "inc/public_header.php";

$ver		= $_REQUEST["ver"];				//版本号
$display	= $_REQUEST["display"];			//屏幕宽高如:480800
$sdk		= $_REQUEST["sdk"];				//Android sdk
$imsi		= $_REQUEST["imsi"];			//IMSI号
$imei		= $_REQUEST["imei"];			//IMEI 号
$platform	= $_REQUEST["platform"];		//platform  0安卓 1苹果

//记录日志
$sql = "
	insert into app_homelog(ver,display,sdk,imsi,imei,platform,dt)
	value('".$ver."','".$display."','".$sdk."','".$imsi."','".$imei."','".$platform."',now())
";
$db->query($sql);

//查询最新记录
$sql = "select json,if(etime<now(),1,0) as oflag from app_page where dr='0' and platform='".$platform."' and ver='".$ver."' and stime<=now() order by stime desc";
$db->query($sql);
while($db->next_record()){
	if($db->f("oflag") == "1"){
		//信息已经过期
		continue;
	}
	echo chs2Unicode($db->f("json"));
	die;
}

?>

